function create_updated_collection(collection_a, object_b) {
  //在这里写入代码
  let arr1 = [];
  let arr2 = object_b.value;
  let obj = {};
  for(let item of collection_a){
    if(!obj[item]){
      obj[item] = {} ;
      if(item.length>1){
        obj[item].key = item[0];
        obj[item].count = parseInt(item[2]);
      }
      else{
        obj[item].key = item ;
        obj[item].count = 1;
      } 
    }
    else{  
      obj[item].count++;
    }
  }

  for(let item in obj){
    arr1.push(obj[item]);
  }
  
  for(let item of arr1){
    for(let n of arr2){
      if(item.key == n){
        item.count=item.count-parseInt(item.count/3);
      }
    }
  }
  return arr1;
}

module.exports = create_updated_collection;
